import Vue from 'vue'
import Router from 'vue-router'
import api from '@/core/api/index'
// console.log(global.getParam())


Vue.use(Router)

const router = new Router({
  routes: [
    {
    path: '/',
    name: '/',
    component: resolve => require(['@/components/home'], resolve),
    redirect: "index",
    children: [{
        path: 'index',
        name: 'index',
        meta: {
          keepAlive: false,
          title: "我是首页"
        },
        component: resolve => require(['@/components/main/index'], resolve)
      },
      {
        path: 'classify',
        name: 'classify',
        meta: {
          keepAlive: false,
          title: "我是分类"
        },
        component: resolve => require(['@/components/main/classify'], resolve),
        redirect: "classify/ziying",
        children: [
        
        {
          path: 'ziying',
          name: 'ziying',
          component: resolve => require(['@/components/child/ziying'], resolve)
        },
        {
          path: 'beishi',
          name: 'beishi',
          component: resolve => require(['@/components/child/beishi'], resolve)
        }
      ]
      },
      {
        path: 'carts',
        name: 'carts',
        component: resolve => require(['@/components/main/carts'], resolve),
        meta: {
          title: "我是测试页"
        }
      },
      {
        path: 'my',
        name: 'my',
        component: resolve => require(['@/components/main/my'], resolve),
      }
    ]
  },
  {
    path: '/desc',
    name: 'desc',
    component: resolve => require(['@/components/main/desc'], resolve),
    meta: {
      keepAlive: false,
      title: "我是详情页"
    }
   
  }
]
})



export default router;
